package com.ks.freezer.controller;


import com.atguigu.commonutils.R;
import com.atguigu.vo.MenuSearchVo;
import com.atguigu.vo.SearchVo;
import com.ks.freezer.feign.SearchFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dCoder
 * @since 2022-04-04
 */
@RestController
@RequestMapping("/freezer")
public class FreezerController {

    @Autowired
    SearchFeign searchFeign;

    @PostMapping("recommendmenu")
    public R recommend(@RequestBody SearchVo searchVo){
        List<MenuSearchVo> menus = searchFeign.getMenus(searchVo);
        return R.ok().data("menus",menus);
    }

}

